import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  // 挂载
  document.getElementById('root'), () => {
    setTimeout(() => {
      // 卸载
      // ReactDOM.unmountComponentAtNode(document.getElementById('root') as HTMLElement)
      // 两者方法看起来相同,上者走react生命周期函数
      // ((document.getElementById('root') as HTMLElement).firstChild as HTMLElement).remove()

    }, 3000);

  }
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
